rebotfandomcom-20200214-history
Lua LuaUnit
LuaUnit Lua representation for a unit, inherits members and methods from LuaGenericObject. Members * Auras - Auras which this unit has active. * PositionPredicted - Predicted position (calculated with position and speed). * MovementSpeed - Current movement speed. * Transport - Transport this unit is on/in. * IsInCombatRange - Is the unit within combat range? * IsInCombatRangeAndLoS - Is the unit in LoS and combat range? * CombatRange - Combat range for this unit. * Pitch - Units pitch rotation. * IsOutdoors - Is this unit outdoors? * Faction - Faction ID for this unit. * IsEnemyFaction - Is this unit part of the enemy faction? * IsTownsfolk - Is this unit considered townsfolk? * IsGuardian - Is this unit a guardian? * DisplayID - DisplayID for the unit. * NativeDisplayID - Native DisplayID for the unit. * TransportGUID - GUID string of the transport this unit is on/in. * CombatReachSq - Combat reach of the unit, squared. * CombatReach - Combat reach of the unit. * BoundingRadius - Bounding radius of the unit. * Class - ID of the unit's class. * Race - ID of the unit's race. * Gender - ID of the unit's gender. * DisplayPower - Display power. * CanNotParticipateInCombat - Can this unit NOT participate in combat? * IsFleeing - Is the unit fleeing? * Level - Level of the unit. * FallingTime - How long this unit has been falling for. * IsFalling - Is this unit falling? * IsSwimming - Is the unit swimming? * Flags - Flags for the unit. * Flags2 - Flags2 for the unit. * IsOnTaxi - Is this unit on a taxi (flightpath)? * DynamicFlags - Dynamic flags for the unit. * NpcFlags - NpcFlags for the unit. * TargetGUID - GUID string of the units target. * Target - LuaUnit object for this unit's target. * Pet - LuaUnit object for this unit's target. * IsPet - Is this unit a pet? * HasAlivePet - Does this unit have a pet which is alive? * Minions - Iterable minion list (see details). * InCombat - Is this unit in combat? * SummonedBy - LuaUnit for this unit's summoner. * SummonerGUID - GUID string for this unit's summoner. * CreatedBy - GUID string for the unit that created this one. * CreatedBySpellID - ID of the spell used to make this unit. * CreatedByObj - LuaUnit object that created this unit. * CharmedBy - GUID string for the unit which charmed this one. * CreatedByMe - Was this unit created by the local player? * Health - Health value for the unit. * MaxHealth - Maximum health value for the unit. * HealthFraction - Health value as a fraction. * HealthMissing - Value of health missing (MaxHealth - Health). * ManaFraction - Mana value as a fraction. * Mana - Mana value for the unit. * MaxMana - Maximum mana value for the unit. * MountDisplayID - Display ID for the mount this unit is using. * IsDead - Is this unit dead? * RemainingCastTime - Remainging time left of this units cast. * CastingTime - Time this unit has been casting for. * ChannelingSpellID - ID of the spell being channeled. * CastingSpellID - ID of the spell being cast. * IsChanneling - Is this unit channeling? * IsCasting - Is this unit casting? * IsLootable - Is this unit lootable? * Direction - Direction vector for this units direction. * Forward - Direction vector for forward of this unit. * Right - Direction vector aimed to the units right. * Classification - ID of this units classification. * CreatureType - ID of this units creature type. * IsFriendly - Is this unit friendly to the player? * IsEnemy - Is this unit an enemy to the player? * IsNeutral - Is this unit neutral to the player? * UnitSelectionColor - Selection colour (target circle/name). * UnitReaction - Integer value for this units reaction to the player. * IsTappedBySomeoneElse - Is this unit tapped be someone/something else? * IsElite - Is this unit classified as elite? * UnitTappedState - Integer value of this units tapped state. * IsInLoS - Is this unit in line-of-sight? * IsInCastingLoS - Is this unit in line-of-sight for casting? * IsSelectable - Can this unit be selected? * IsAttackable - Can this unit be attacked right now? * IsAttackableUnit - Can this unit be attacked? * IsTargetingMeOrPets - Is this unit targeting the player or one of its pets? * IsFlying - Is this unit flying? * IsPlayer - Is this unit a player? * IsMoving - Is this unit moving? Methods * IsBehind - Checks if this unit is behind a unit/position. * SetRotationVector - Set the rotation of this unit. * GetRotationVector - Get the rotation of this unit. * IsFacing - Check if this unit is facing a unit/position. * GetClassColor - Get the colour of this unit's class. * GetAggroRadiusSafe - Check the aggro radius. * HasNPCFlag - Check if this unit has a specific NPC flag. * HasUnitFlag - Check if this unit has a specific unit flag. * HasDynamicFlag - Check if this unit has a specific dynamic flag. * GetPower - Get the value of a certain power type for this unit. * HasPower - Check if this unit has a certain type of power. * IsCastingAndInterruptible - Is the unit casting and can it be interrupted? * GetAuraStackCount - Get the amount of stacks of a specific aura. * HasAura - Check if this unit has a specific aura. * AuraTimeRemaining - Time remaining for a specific aura. * AimAt - Aim at a position (cannons etc).